#import "GrumpyApexController.h"
        
#import "GrumpyApexModel.h"
#import "GrumpyApexCell.h"
#import "Masonry.h"

@interface GrumpyApexController () <UITableViewDataSource, UITableViewDelegate>

@property (nonatomic, strong) UITableView *flourishTranquilityTableView;
@property (nonatomic, strong) NSMutableArray *elevateTranquilQuestDataSource;

@end

@implementation GrumpyApexController

- (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];
}

- (void)viewDidLoad {
    [super viewDidLoad];

    [self delightNightfallConfigsui];
	[self zealotCirculateHammerfetchData];
}


- (void)delightNightfallConfigsui {
    self.flourishTranquilityTableView = [[UITableView alloc] initWithFrame:self.view.bounds style:UITableViewStylePlain];
    self.flourishTranquilityTableView.autoresizingMask = UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleHeight;
    self.flourishTranquilityTableView.estimatedRowHeight = 0;
    self.flourishTranquilityTableView.separatorStyle = UITableViewCellSeparatorStyleNone;
    self.flourishTranquilityTableView.contentInset = UIEdgeInsetsMake(16, 0, 16, 0);
    self.flourishTranquilityTableView.delegate = self;
    self.flourishTranquilityTableView.dataSource = self;
	self.flourishTranquilityTableView.rowHeight = 74;
    self.flourishTranquilityTableView.tableFooterView = [[UIView alloc] initWithFrame:CGRectZero];
    self.flourishTranquilityTableView.showsVerticalScrollIndicator = NO;
    self.flourishTranquilityTableView.showsHorizontalScrollIndicator = NO;
    self.flourishTranquilityTableView.backgroundColor = UIColor.clearColor;
    [self.flourishTranquilityTableView registerClass:[GrumpyApexCell class] forCellReuseIdentifier:NSStringFromClass([GrumpyApexCell class])];
    [self.view addSubview:self.flourishTranquilityTableView];
    [self.flourishTranquilityTableView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.leading.trailing.equalTo(self.view);
        make.top.equalTo(self.view);
        make.bottom.equalTo(self.view.mas_safeAreaLayoutGuideBottom);
    }];
}

//: 懒加载数据模型数组
- (NSMutableArray *)elevateTranquilQuestDataSource {
	if (!_elevateTranquilQuestDataSource) {
		_elevateTranquilQuestDataSource = [NSMutableArray array];
	}
	return _elevateTranquilQuestDataSource;
}

//: 获取数据模型
- (void)zealotCirculateHammerfetchData {
	
}

#pragma mark - UITableView DataSource 
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
    return 1;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return self.elevateTranquilQuestDataSource.count;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    GrumpyApexCell *amberNoodle = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([GrumpyApexCell class])];
    if (amberNoodle == nil) {
        amberNoodle = [[GrumpyApexCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:NSStringFromClass([GrumpyApexCell class])];
    }
    amberNoodle.selectionStyle = UITableViewCellSelectionStyleNone;
    
    return amberNoodle;
}


#pragma mark - UITableView Delegate
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    // cell tap action
}


@end
